home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SEUtils.h
-
- Contains: xxx put contents here xxx
-
- Owned by: Jon Pugh
-
- Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <5> 12/13/96 JP 1611571: Renamed parameter
- <4> 9/26/96 JP 1372897: Added CompareDescs utility.
- <3> 9/24/96 TJ Added Includes
- <2> 9/23/96 JP 1384958: Moved routines from SEPriv.h,
- renamed GetDefaultRootFrame & added
- ShouldHandleEvent
-
- To Do:
- */
-
- /*
- File: SEUtils.h
-
- Contains: Interface to Semantic Events Utility Functions
-
- Owned by: Nick Pilch
-
- Copyright: © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
-
-
- In Progress:
-
- */
-
- #ifndef _SEUTILS_
- #define _SEUTILS_
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef SOM_ODPart_xh
- #include "Part.xh"
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- // the type should determine how many bytes are moved....
-
- class ODAppleEvent;
- class ODNameResolver;
- class ODOSLToken;
-
- #define SETBYTESOFHANDLE(h,typ,data,skipbytes) \
- *((typ*)((*(h))+(skipbytes))) = (data) \
-
- #define GETBYTESOFHANDLE(h,typ,skipbytes) \
- *((typ*)((*(h))+(skipbytes))) \
-
- #define SETFIRSTBYTESOFHANDLE(h,typ,data) \
- SETBYTESOFHANDLE(h,typ,data,0) \
-
- #define FIRSTBYTESFROMHANDLE(h, typ) \
- GETBYTESOFHANDLE(h,typ,0) \
-
- const Boolean kFromTypeIsDesc = kODTrue;
- const Boolean kFromTypeIsPtr = kODFalse;
- const Boolean kIsSysHandler = kODTrue;
-
- const ODSLong kODCountProcSwapValue = -1;
-
- #define NULL_DESCRIPTOR_DEFINITION {typeNull, NULL}
-
- extern "C" {
-
- ODBoolean MissingParams(const AppleEvent* message);
- OSErr DecodeOrdinal(AEDesc ordData, long count, long* index,
- Boolean* allFlag, Boolean* zeroFlag);
- ODSLong GetSLongAttr(AppleEvent* ae, AEKeyword keyword);
- ODSLong GetSLongAttrOD(ODAppleEvent* ae, AEKeyword keyword);
-
- // does an in-place coercion!
- void ThrowIfCantCoerce( AEDesc* data, DescType desiredType ) ;
- void ThrowIfNotAbsent( OSErr err ) ;
- ODSLong CountEmbeddedParts(Environment* ev, ODPart* prt);
-
- void UpdateUserToken(Environment* ev, ODNameResolver* resolver,
- ODOSLToken* odToken, AEDesc* desc);
- // Update the user token in odToken with data in desc. desc is disposed.
-
- // do a double-dispose of AppleEvents that are copies of what might be
- // send-to-self events, since copies of these (eg. what you get when you
- // call ODDescToAEDesc) cannot be disposed with a single call to AEDisposeDesc.
- OSErr ODDisposeAppleEvent( AppleEvent* aevt );
-
- struct StandardPartToken
- {
- ODFrame* fFrame;
- ODPart* fPart;
- };
- typedef struct StandardPartToken StandardPartToken, *StandardPartTokenPtr;
-
- ODFrame* FrameFromStandardPartToken(AEDesc* token);
-
- ODPart* PartFromStandardPartToken(AEDesc* token);
-
- void PartFrameFromStandardPartToken(AEDesc* token, ODPart** part, ODFrame** frame);
-
- ODBoolean CanBeStandardPartToken( AEDesc* token );
-
- OSErr CreateStandardPartToken( ODFrame* frame, ODPart* part, AEDesc* newToken );
-
- ODFrame* GetDefaultRootFrame(Environment *ev, ODSession* session);
-
- pascal ODBoolean ShouldHandleEvent( ODPart* part,
- ODAppleEvent* message,
- ODAppleEvent* reply,
- ODSession* session);
-
- ODBoolean CompareDescs(const AEDesc *desc1, ODDescType operation, const AEDesc *desc2);
-
- inline void MakeNULLDesc(AEDesc* desc)
- {
- desc->descriptorType = typeNull;
- desc->dataHandle = NULL;
- } // MakeNULLDesc
-
- } // extern "C"
-
- #endif // _SEUTILS_
-